package com.ls.thread.car;

public class Bridge {
	
	private boolean flag=true;
	
	public void tg(){
		if(flag){
			try {
			notify();
			for(int i=0;i<4;i++){
				System.out.println("pass");
			}
				wait();
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}else{
			try {
			notify();
			System.out.println("dengdai");
				wait();
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
}
